Using Skip list to copy module to another module

Hi everyone,

I have to copy a view of module to other module with Skip list.

So my idea is using 2 Skip list:

Skip source_module with key = moduleID of source module, data = string name of view

Skip dest_module with key = moduleID of destination module, data = moduleID of destination module

So, this looks something like this ( I took some code from Google):

pragma runLim, 0

Module source_module, destination_module 

Skip sk_source_module = createString
put(sk_source_module, "00089fs8", "_nameofView")

Skip sk_destination_module = createString
put(sk_destination_module , "00045fs9", "00045fs9")

Module returnModulefromModuleID(string str_ModuleID){

    Module modCurrent = null
    Item itmCurrent
    string strCurrent = ""

    itmCurrent = itemFromID(str_ModuleID)
                
    if (itmCurrent == null)
        {
            modCurrent = null
        }
    else
        {
            strCurrent = fullName(itmCurrent)
            modCurrent = read(strCurrent, false)
        }

    return(modCurrent)
}

void copyViews(Module source_module, Module destination_module)
{

////

}

void main(Skip sk_source_module, Skip sk_destination_module){
    string str_source_module, str_destination_module
    string str_view = ""

    for str_source_module in sk_source_module do {

        str_source_module = (string key sk_source_module)
        source_module = returnModulefromModuleID(str_source_module)

        for str_destination_module in sk_destination_module do {
            
            str_destination_module = (string key sk_destination_module)
            destination_module = returnModulefromModuleID(str_destination_module)
            if(find(sk_source_module, str_source_module, str_view)){
               copyViews(source_module, destination_module, str_view)
            }
        }
    }
}

main(sk_source_module, sk_destination_module)

In my mind, I have 2 ideas for the "copyViews" function. First idea is, just simply using for loop for every column in source module and put to destination module. Second idea is, using Skip list to save the column of source module then put them in destination module. But the Problem is, I am still newbie with DXL Skript so I don't really know how to write the function copyViews farther. 

Can anyone please help me?

Any kind of help is really appreciated.

Thanks,

Jonny


Jonny Tim - Thu Oct 25 14:09:45 EDT 2018

Re: Using Skip list to copy module to another module
Jonny Tim - Mon Oct 29 08:55:25 EDT 2018

Please help!

Re: Using Skip list to copy module to another module
Mike.Scharnow - Mon Oct 29 09:07:37 EDT 2018

Jonny Tim - Mon Oct 29 08:55:25 EDT 2018

Please help!

why don't you use the script from https://www-01.ibm.com/support/docview.wss?uid=swg21508655?

Copying views is quite complicated, there are a lot of things to remember, different types of columns, dxl code, sizes, settings etc. etc. 

Re: Using Skip list to copy module to another module
Jonny Tim - Fri Nov 02 08:56:14 EDT 2018

Mike.Scharnow - Mon Oct 29 09:07:37 EDT 2018

why don't you use the script from https://www-01.ibm.com/support/docview.wss?uid=swg21508655?

Copying views is quite complicated, there are a lot of things to remember, different types of columns, dxl code, sizes, settings etc. etc. 

Thanks for your advice but I have already solved the problem.